<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="动画效果.js"></script>
    <style>
        .father {
            width: 300px;
            height: 300px;
            background-color: aquamarine;
            position: relative;
        }
        .son {
            width: 100px;
            height: 100px;
            background-color: blanchedalmond;
            position: absolute;
            left: 0;
        }
    </style>
</head>
<body>
    <button>点击动</button>
    <div class="father">
        <div class="son"></div>
    </div>
    <script>
        var son = document.querySelector('.son');
        var btn = document.querySelector('button');
        btn.addEventListener('click', function() {
            aimate(son, 1000);
        });
    </script>
</body>
</html>